package com.defangit.production.domain;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 工时记录实体类
 */
public class TimeSheet {
    private int id;
    private ProductionProcess process;
    private Operator operator;
    private LocalDateTime startTime=LocalDateTime.now();
    private LocalDateTime endTime;
    private double period;
    private List<ProcessTime> processTimes = new ArrayList<>();

    public List<ProcessTime> getProcessTimes() {
        return processTimes;
    }

    public TimeSheet setProcessTimes(List<ProcessTime> processTimes) {
        this.processTimes = processTimes;
        return this;
    }

    public int getId() {
        return id;
    }

    public TimeSheet setId(int id) {
        this.id = id;
        return this;
    }
    /**
     * 工时所属的工序派工单
     * @return 工时所属的工序派工单
     */
    public ProductionProcess getProcess() {
        return process;
    }

    public TimeSheet setProcess(ProductionProcess process) {
        this.process = process;
        return this;
    }
    /**
     * 工时单记录所属的员工
     * @return 工时单记录所属的员工
     */
    public Operator getOperator() {
        return operator;
    }

    public TimeSheet setOperator(Operator operator) {
        this.operator = operator;
        return this;
    }
    /**
     * 工时单开始时间
     * @return 工时单开始时间
     */
    public LocalDateTime getStartTime() {
        return startTime;
    }

    public TimeSheet setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
        return this;
    }
    /**
     * 工时单结束时间
     * @return 工时单结束时间
     */
    public LocalDateTime getEndTime() {
        return endTime;
    }

    public TimeSheet setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
        return this;
    }

    /**
     * 工时单记录的总工时
     * @return 工时单记录的总工时
     */
    public double getPeriod() {
        return period;
    }

    public TimeSheet setPeriod(double period) {
        this.period = period;
        return this;
    }
}
